Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC and test fixes #1712

Merged
merged 4 commits into from
Nov 9, 2020
Merged

gRPC and test fixes #1712

merged 4 commits into from
Nov 9, 2020

Conversation

na--
Copy link
Member

@na-- na-- commented Nov 6, 2020

This adds a bunch of tests and changes one details in the gRPC JS API: instead of grpc.newClient(), we now have the more JS idiomatic new grpc.Client().

cc @rogchap

@na-- na-- requested review from imiric and mstoykov November 6, 2020 15:20
@na-- na-- changed the title [WIP] and test fixes [WIP] gRPC and test fixes Nov 6, 2020
mstoykov
mstoykov previously approved these changes Nov 6, 2020
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the race which is the same/very similar to #1657 ... and might actually be a bug in the way RunContext is used ... This might need more investigation, but probably after the release.

@na-- na-- force-pushed the grpc-and-test-fixes branch 2 times, most recently from 5abc465 to 18c17d7 Compare November 9, 2020 09:04
@na-- na-- changed the title [WIP] gRPC and test fixes gRPC and test fixes Nov 9, 2020
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just minor comments. And CI currently fails on TestComplicatedFileImportsForGRPC.

Comment on lines +43 to +64
checkModule := &CheckModule{t: t}
modules.Register("k6/check", checkModule)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that this gives us a simple way to bridge JS with Go test code. This approach might help with some flaky tests that currently rely on timing instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just have to remember to use different packages for registering new k6 modules that help with testing... Given the singleton nature of the module registry, we don't want "pollution"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that could be a problem. Should we add some kind of Deregister mechanism so that each test can clean up after itself? Since it's in internal we don't have to make it public and could only use it in tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shouldn't really matter if such tests are in their own package, but sure, an internal de-registering function can be added in the future

@na-- na-- force-pushed the grpc-and-test-fixes branch from 18c17d7 to 24bf54c Compare November 9, 2020 13:10
@codecov-io
Copy link

codecov-io commented Nov 9, 2020

Codecov Report

Merging #1712 (24bf54c) into master (4385b52) will increase coverage by 0.06%.
The diff coverage is 92.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1712      +/-   ##
==========================================
+ Coverage   71.40%   71.46%   +0.06%     
==========================================
  Files         176      178       +2     
  Lines       13679    13719      +40     
==========================================
+ Hits         9767     9804      +37     
- Misses       3301     3303       +2     
- Partials      611      612       +1     
Flag Coverage Δ
ubuntu 71.42% <88.00%> (+0.06%) ⬆️
windows 70.01% <92.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
js/internal/modules/modules.go 75.00% <75.00%> (ø)
js/modules/k6/grpc/client.go 79.18% <84.61%> (+1.31%) ⬆️
js/bundle.go 90.54% <100.00%> (+0.33%) ⬆️
js/common/context.go 100.00% <100.00%> (ø)
js/common/initenv.go 100.00% <100.00%> (ø)
js/initcontext.go 92.13% <100.00%> (ø)
js/modules/k6/crypto/crypto.go 97.19% <100.00%> (+0.02%) ⬆️
js/modules/k6/crypto/x509/x509.go 98.05% <100.00%> (+0.01%) ⬆️
js/modules/k6/encoding/encoding.go 93.10% <100.00%> (+0.24%) ⬆️
js/modules/k6/grpc/grpc.go 100.00% <100.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fca463...24bf54c. Read the comment docs.

@na-- na-- merged commit 012f1aa into master Nov 9, 2020
@na-- na-- deleted the grpc-and-test-fixes branch November 9, 2020 14:39
@na-- na-- added this to the v0.29.0 milestone Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants